package com.xiangge.demo;

import com.xiangge.domain.Actor;
import com.xiangge.domain.Player;

public class OOPDemo3 {
    public static void main(String[] args) {
       /*
        actor a = new player();
        a.action();
        a.school()*/; // 对象调用属性时：编程时看左边，运行输出还是看左边
        // 输出actor的age属性
        /*a.introduction();*/ // 对象调用行为时：编程时看左边，但运行输出是看右边
        // 输出player的introduction
    }
}
class player{
    public String action;
    public String score;
    public void introduction(){
        System.out.println("是个"+action+"，今年拿到了"+score);
    }
}
class actor extends player{
    public String school;
    public String creation;
    public void introduction(){
        System.out.println("毕业于"+school+"，代表作《"+creation+"》");
        System.out.println("擅长唱、跳、rap、篮球");
        System.out.println("music！");
    }
}